#!/bin/bash

# This shell script orchestrates the calibrated simulations and plots generation for Figure 9.

betaDD=(155 160 165 170 175 180 185 190 195 200 225 250 275 300 310 "calibrated" 345 360 375 400 420 435 450 500)
betaSD=(100 "calibrated" 600)

for sd in "${betaSD[@]}"
do
  for dd in "${betaDD[@]}"
  do
    nohup Rscript figure-9.1--run-calibrated-simulation.r 0.03 "$nSims" "$dd" "$sd" &
  done
  wait
done

returnsGrowthRate=(0.025 0.0255 0.026 0.0265 0.027 0.0275 0.028 0.0285 0.029 0.0295 0.03 0.0325 0.035 0.0375 0.04 0.045 0.05 0.055 0.06 0.075 0.9 0.1)

for growthRate in "${returnsGrowthRate[@]}"
do
  nohup Rscript figure-9.1--run-calibrated-simulation.r "$growthRate" "$nSims" "calibrated" "calibrated" &
done

Rscript figure-9.2--generate-plots.r 